# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")
load("//build_tools/bazel:iree_lit_test.bzl", "iree_lit_test_suite")

package(
    features = ["layering_check"],
    licenses = ["notice"],  # Apache 2.0
)

iree_lit_test_suite(
    name = "lit",
    srcs = enforce_glob(
        [
            "annotate_data_tiling_hints.mlir",
            "bitcast_unsupported_element_types.mlir",
            "clone_producers_into_dispatch_regions.mlir",
            "collapse_dimensions.mlir",
            "collapse_linalg_generic_on_tensors.mlir",
            "elementwise_op_fusion.mlir",
            "dispatch_region_formation_preprocessing.mlir",
            "fold_unit_dims.mlir",
            "form_dispatch_regions.mlir",
            "dispatch_linalg_on_tensors.mlir",
            "convert_encoding_to_flow.mlir",
            "convert_region_to_workgroups.mlir",
            "bubble_up_expand_shapes.mlir",
            "bubble_up_extract_slice.mlir",
            "form_dispatch_workgroups.mlir",
            "dispatch_linalg_ext_fusion.mlir",
            "hoist_encoding_ops.mlir",
            "hoist_uniform_scalar_compute.mlir",
            "dispatch_linalg_on_tensors_default.mlir",
            "dispatch_linalg_on_tensors_fusion_with_transpose.mlir",
            "form_scalar_dispatches.mlir",
            "form_split_reduction_dispatches.mlir",
            "fuse_encoding_ops_into_dispatch_regions.mlir",
            "fuse_horizontal_contractions.mlir",
            "fuse_multiuse_elementwise_producer.mlir",
            "fuse_multiuse_intra_dispatch.mlir",
            "fusion_preprocessing.mlir",
            "materialize_default_workgroup_count_region.mlir",
            "pad_fusion_with_consumer.mlir",
            "pad_fusion_with_producer.mlir",
            "pipeline_tests.mlir",
            "pipeline_tests_aggressive.mlir",
            "pipeline_tests_split_reduction.mlir",
            "propagate_encodings.mlir",
            "set_encoding.mlir",
            "set_encoding_padding.mlir",
            "set_encoding_pipeline.mlir",
            "set_split_reduction_sizes.mlir",
            "sink_reshapes.mlir",
            "split_reduction.mlir",
            "tensor_pad_to_tensor_insert_slice.mlir",
            "transpose_generic_ops.mlir",
        ],
        include = ["*.mlir"],
    ),
    cfg = "//compiler:lit.cfg.py",
    tools = [
        "//tools:iree-opt",
        "@llvm-project//llvm:FileCheck",
    ],
)
